package com.jt.safe.exception

import com.jt.safe.extension.parseErrorString

class HubException : Exception {
    var errorMsg: String

    constructor(error: String) : super(error) {
        errorMsg = error
    }

    constructor(throwable: Throwable?) : super(throwable) {
        errorMsg = parseError(throwable)
    }

    private fun parseError(throwable: Throwable?): String {
        return throwable.parseErrorString()
    }
}